#ifndef _ECHART_H
#define _ECHART_H

#include "Eina.h"

/**
 * @mainpage Echart
 * @section intro Introduction
 *
 * @section dependencies Dependencies
 * - Eina
 *
 * @file
 * @brief Echart API
 * @defgroup Echart_Group API
 * @{
 *
 * @todo
 */

typedef struct _Echart Echart;
typedef struct _Echart_Dataset Echart_Dataset;
typedef struct _Echart_Data Echart_Data;
typedef struct _Echart_Backend Echart_Backend;

typedef uint32_t Echart_Color;

typedef enum _Echart_Type
{
	ECHART_TYPE_BAR,
	ECHART_TYPE_LINE,
	ECHART_TYPES,
} Echart_Type;

EAPI void echart_init(void);
EAPI void echart_shutdown(void);

EAPI Echart_Backend * echart_gchart_get(void);

EAPI void echart_free(Echart *ec);
EAPI void echart_title_set(Echart *ec, const char *title);
EAPI char * echart_title_get(Echart *ec);
EAPI void echart_title_color_set(Echart *ec, Echart_Color color);
EAPI Echart_Color echart_title_color_get(Echart *ec);
EAPI Echart_Type echart_type_get(Echart *ec);
EAPI Echart_Dataset * echart_dataset_get(Echart *ec);
EAPI void echart_generate(Echart *ec, Echart_Backend *backend, void *data);

EAPI void echart_dataset_add(Echart *ec, Echart_Dataset *ds);
EAPI void echart_dataset_remove(Echart *ec, Echart_Dataset *ds);
EAPI void echart_dataset_free(Echart_Dataset *ds);
EAPI Echart_Dataset * echart_dataset_next(Echart_Dataset *ds);
EAPI Echart_Dataset * echart_dataset_prev(Echart_Dataset *ds);
EAPI void echart_dataset_label_set(Echart_Dataset *ds, const char *label);
EAPI const char * echart_dataset_label_get(Echart_Dataset *ds);

EAPI int echart_dataset_values_get(Echart_Dataset *ds, double **values);
EAPI void echart_dataset_value_add(Echart_Dataset *ds, double value);
EAPI void echart_dataset_values_add(Echart_Dataset *ds, int count, ...);

/**
 * @defgroup Echart_Bar_Group Bar
 * @{
 */
typedef enum _Echart_Bar_Type
{
	ECHART_BAR_HORIZONTAL_STACKED,
	ECHART_BAR_VERTICAL_STACKED,
	ECHART_BAR_VERTICAL_OVERLAPPED,
	ECHART_BAR_HORIZONTAL_GROUPED,
	ECHART_BAR_VERTICAL_GROUPED,
	ECHART_BAR_TYPES,
} Echart_Bar_Type;

EAPI Echart * echart_bar_new(void);
EAPI Echart_Dataset * echart_bar_dataset_new(void);
EAPI void echart_bar_type_set(Echart *ec, Echart_Bar_Type type); 
EAPI Echart_Bar_Type echart_bar_type_get(Echart *ec);

EAPI void echart_dataset_color_set(Echart_Dataset *ds, Echart_Color color);
EAPI Echart_Color echart_dataset_color_get(Echart_Dataset *ds);

/**
 * @}
 */

/**
 * @}
 */

#endif /*_ECHART_H*/
